package com.wanxi.servlet.nav;//package com.wanxi.servlet.nav;
//
//import com.alibaba.fastjson2.JSONObject;
//import com.wanxi.model.NavModel;
//import com.wanxi.model.ResultModel;
//import com.wanxi.service.NavService;
//import com.wanxi.service.impl.NavServiceImpl;
//import com.wanxi.util.Tool;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//
//@WebServlet("/back/nav/add")
//public class NavAddServlet extends HttpServlet {
//    @Override
//    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        //        1.乱码处理
////        req.setCharacterEncoding("UTF-8");
////        resp.setCharacterEncoding("UTF-8");
////        2.得到前端的值
////        page 第几页 limit 每一页显示的条数
//        String title = req.getParameter("title");
//        String isShow = req.getParameter("isShow");
//        String href = req.getParameter("href");
//
//
////        3.封装到model
//        NavModel navModel = new NavModel();
//        navModel.setTitle(Tool.nullToStr(title));
//        navModel.setIsShow(Tool.strToInt(isShow));
//        navModel.setHref(Tool.nullToStr(href));
//
////        4.调用service
//        NavService navService = new NavServiceImpl();
////        5.得到返回值
//        ResultModel resultModel = navService.add(navModel);
////        6.返回给前端
//        resp.getWriter().println(JSONObject.toJSONString(resultModel));
//    }
//}
